﻿using IM.Easy.Core.Audit;
using SqlSugar;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace IM.Easy.Entity.System
{
    /// <summary>
    /// 组织机构岗位关系表（岗位编制）
    /// </summary>
    [SugarTable(TableDescription = "组织机构岗位关系表")]
    public class SysOrgPost : AuditSnowflakeEntity, IActive
    {
        /// <summary>
        /// 组织机构ID
        /// </summary>
        [SugarColumn(ColumnDescription = "组织机构ID")]
        public long OrgId { get; set; }

        /// <summary>
        /// 岗位ID
        /// </summary>
        [SugarColumn(ColumnDescription = "岗位ID")]
        public long PostId { get; set; }

        /// <summary>
        /// 编制人数
        /// </summary>
        [SugarColumn(ColumnDescription = "岗位编制人数")]
        public int StaffingNum { get; set; }

        /// <summary>
        /// 实际在岗人数
        /// </summary>
        [SugarColumn(ColumnDescription = "当前在岗人数")]
        public int ActualNum { get; set; }

        /// <summary>
        /// 备注信息
        /// </summary>
        [SugarColumn(ColumnDescription = "备注", Length = 500, IsNullable = true)]
        public string Remark { get; set; }

        public bool IsActive { get; set; }

        /// <summary>
        /// 岗位信息
        /// </summary>
        [Navigate(NavigateType.OneToOne, nameof(PostId))]
        public SysPost Post { get; set; }

        /// <summary>
        /// 组织机构信息
        /// </summary>
        [Navigate(NavigateType.OneToOne, nameof(OrgId))]
        public SysDepartment Org { get; set; }
    }
}
